var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, o, n) {
    var i, r = arguments.length, a = r < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, o, n); else for (var c = e.length - 1; 0 <= c; c--) (i = e[c]) && (a = (r < 3 ? i(a) : 3 < r ? i(t, o, a) : i(t, o)) || a);
    return 3 < r && a && Object.defineProperty(t, o, a), a;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("MyScrollView"), c = e("SkinView"), l = e("AudioManager"), d = e("PrefabView"), u = e("EggsHintView"), p = e("EggsArmView"), h = e("EggsPetView"), f = e("GameConfig"), g = e("EggsManager"), m = e("UIManager"), y = e("WebManager"), v = cc._decorator, w = v.ccclass, b = v.property, P = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.hintView = null, e.armView = null, e.petView = null, e.skinView = null, 
        e.nodes = null, e.petToggle = null, e.skinToggle = null, e.codeToggle = null, e;
    }
    return i(e, t), e.prototype.onDestroy = function() {
        t.prototype.onDestroy.call(this), m.default.getInstance().showPnl("start");
    }, e.prototype.onClickBack = function() {
        l.default.getInstance().playAudio("按钮2"), y.default.getInstance().sentLog("点击彩蛋墙界面返回按键"), 
        this.hidePnl();
    }, e.prototype.onClickToggle = function(e) {
        var o = e.node.getSiblingIndex();
        this.nodes.children.forEach(function(e, t) {
            return e.active = t == o;
        });
    }, e.prototype.start = function() {
        this.init();
    }, e.prototype.init = function() {
        if ((-1 < g.default.getInstance().checkEggPet(0) || -1 < g.default.getInstance().checkEggPet(1)) && (this.petToggle.active = !0), 
        0 < g.default.getInstance().eggPDataMap.size) {
            for (var e = [], t = r.G.eggPersonModelList.length - 1; 0 <= t; t--) {
                var o = r.G.eggPersonModelList[t];
                g.default.getInstance().eggPDataMap.has(o.id) && -1 < g.default.getInstance().checkEggPerson(o.id) && e.push(o);
            }
            0 < e.length && (this.skinToggle.active = !0, this.skinView.init(e.map(function(e) {
                var t = new c.SkinItemData();
                return t.rank = e.id, t.type = c.SkinItemType.EGG, t;
            })));
        }
        f.GC.isVaild("code") || (this.codeToggle.active = !0);
    }, a([ b(u.default) ], e.prototype, "hintView", void 0), a([ b(p.default) ], e.prototype, "armView", void 0), 
    a([ b(h.default) ], e.prototype, "petView", void 0), a([ b(s.default) ], e.prototype, "skinView", void 0), 
    a([ b(cc.Node) ], e.prototype, "nodes", void 0), a([ b(cc.Node) ], e.prototype, "petToggle", void 0), 
    a([ b(cc.Node) ], e.prototype, "skinToggle", void 0), a([ b(cc.Node) ], e.prototype, "codeToggle", void 0), 
    a([ w ], e);
}(d.default);

n.default = P;